import request from '@/utils/request'

export default{
  // 5、查询章节嵌套集合
  getChapters(courseId) {
    return request({
      url: `/admin/edu/chapter/getNestedChapters/${courseId}`,
      method: 'GET'
    })
  },
  // 1、查询指定章
  getById(id) {
    return request({
      url: `/admin/edu/chapter/getById/${id}`,
      method: 'GET'
    })
  },
  // 2、更新章
  update(chapter) {
    return request({
      url: '/admin/edu/chapter/update',
      method: 'PUT',
      data: chapter
    })
  },
  // 3、新增章
  save(chapter) {
    return request({
      url: '/admin/edu/chapter/save',
      method: 'POST',
      data: chapter
    })
  },
  // 4、删除章
  delete(id) {
    return request({
      url: `/admin/edu/chapter/remove/${id}`,
      method: 'DELETE'
    })
  }

}
